import { parse } from 'qs'
import { request, config } from '../utils';
const { api } = config
const { auth: authApi, login: loginApi, logout: logoutApi } = api

export async function login (params) {
  return request({
    url: loginApi,
    method: 'post',
    data: params,
  })
}

export async function logout (params) {
  return request({
    url: logoutApi,
    method: 'get',
    data: params,
  })
}

export async function auth (params) {
  return request({
    url: authApi,
    method: 'get',
    data: parse(params),
  })
}
